package com.ruoyi.ring.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.ring.config.ArrayToStringDeserializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 锻炼详情对象 az_ring_exercise_detail
 * 
 * @author liuwp
 * @date 2025-09-25
 */
@Data
public class RingExerciseDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 设备sn */
    @Excel(name = "设备sn")
    private String deviceSn;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 锻炼类型（锻炼表主键ID） */
    @Excel(name = "锻炼类型", readConverterExp = "锻=炼表主键ID")
    private Long exerciseId;

    /** 原始开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "原始开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date rawStartTime;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 有效时间 */
    @Excel(name = "有效时间")
    private Long validTime;

    /** 步数 */
    @Excel(name = "步数")
    private Long steps;

    /** 距离 */
    @Excel(name = "距离")
    private Long distance;

    /** 卡路里 */
    @Excel(name = "卡路里")
    private Long calories;

    /** 目标类型 */
    @Excel(name = "目标类型")
    private Long goalType;

    /** 目标值 */
    @Excel(name = "目标值")
    private Long goalValue;

    /** hr列表 */
    @Excel(name = "hr列表")
    @JsonProperty("hrList")
    @JsonDeserialize(using = ArrayToStringDeserializer.class)
    private String hrList;

    /** 配速 */
    @Excel(name = "配速")
    private String pace;

    /** 地图坐标 */
    @Excel(name = "地图坐标")
    private String mapCoordinates;

    /** 记录日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date recordDate;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("deviceSn", getDeviceSn())
            .append("userId", getUserId())
            .append("exerciseId", getExerciseId())
            .append("rawStartTime", getRawStartTime())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("validTime", getValidTime())
            .append("steps", getSteps())
            .append("distance", getDistance())
            .append("calories", getCalories())
            .append("goalType", getGoalType())
            .append("goalValue", getGoalValue())
            .append("hrList", getHrList())
            .append("pace", getPace())
            .append("mapCoordinates", getMapCoordinates())
            .append("recordDate", getRecordDate())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
